package com.zhudeshuai.zhudemolist.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.zhu.zhuCore.widget.CommonDialog;
import com.zhudeshuai.zhudemolist.R;
import com.zhudeshuai.zhudemolist.base.BaseActivity;
import com.zhudeshuai.zhudemolist.util.ToastUtil;

/**
 * @author zhudeshuai
 * @since 16/6/17
 */
public class CommonDialogDemoActivity extends BaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_common_dialog);
    }

    public void show(View view) {
        CommonDialog dialog = new CommonDialog(this);
        dialog.addItem("条目1", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtil.showToast("条目1");
            }
        });
        dialog.addItem("条目2", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtil.showToast("条目2");
            }
        });
        dialog.show();
    }

    public static void open(Activity activity) {
        activity.startActivity(new Intent(activity, CommonDialogDemoActivity.class));
    }
}
